function getColByTaskType(taskType,state) {
    let showCheckBox=false;
    if(taskType==1&&state>1){
        showCheckBox=true;
    }
    if(taskType==2&&state>2){
        showCheckBox=true;
    }
    if(taskType == 2){
       return  [[
            {type: 'checkbox',hide:showCheckBox ,fixed: 'left'},
            {type:'numbers',title:'序号',fixed:'left',width:80,align:'center'},
            { field: 'systemName',align:'center', minWidth:200, title: '系统名称' },
            { field: 'totalScore', align:'center',width:110, title: '系统总分' },
            { field: 'pfPerson',align:'center', width: 110, title: '自评人' },
            { field: 'pfScoreWeight', align:'center',width: 110, title: '自评得分' ,templet:function(d){
                return d.pfScoreZz+' / '+ d.pfScoreWeight;
            }},
            {
                field: 'zpState', align:'center',width: 110, title: '自评状态', templet: function (d) {
                    if (d.zpState == null) {
                        return '<span >--</span>';
                    } else if (d.zpState === 1) {
                        return '<span class="layui-font-red ">未提交</span>';
                    } else if (d.zpState === 2) {
                        return '<span class="layui-font-green">已提交</span>';
                    }
                }
            },
            { 
                field: 'hyPerson',align:'center', width: 110, title: '核验人',templet:function(d){
                    if(d.taskType==1){
                        return '<span >--</span>';
                    } else if (d.taskType==2 && d.hyPerson != null && state>1) {
                        return `<span >${d.hyPerson}</span>`;
                    }else{
                        return `<span>--</span>`;
                    }
                }
            },
            {
                field: 'hyScore', align:'center',width: 110, title: '核验得分', templet: function (d) {
                    if(d.taskType==1){
                        return '<span >--</span>';
                    } else if (d.taskType==2 && d.hyScore != null && state>1) {
                        return `<span >${d.hyScoreZz+' / '+d.hyScoreWeight}</span>`;
                    }else{
                        return `<span>--</span>`;
                    }
                }
            },
            {
                field: 'hyState',align:'center', width: 110, title: '核验状态', templet: function (d) {
                    if (d.hyState == null) {
                        return '<span >--</span>';
                    } else if (taskType === 1) {
                        return '<span class="layui-font-purple ">无需核验</span>';
                    } else if (d.hyState === 1) {
                        return '<span class="layui-font-red ">未提交</span>';
                    } else if (d.hyState === 2) {
                        return '<span class="layui-font-green">已提交</span>';
                    }
                }
            },
            {
                field: 'modifyTime',align:'center', width: 180, title: '最后修改时间', templet: function (d) {
                    return d.modifyTime == null ? d.createTime : d.modifyTime;
                }
            },
            {
                title: '操作',
                fixed:'right',
                style:'text-align:left;',
                minWidth: 220,
                templet: function (d) {
                    var roleType = localStorage.getItem("roleType"); // 获取角色类型
                    var buttons = ''; // 按钮字符串
                    // 根据 roleType 和相关状态判定按钮显示的逻辑
                    if (roleType === '4') {
                        if (d.zpState === 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zp"><i class="layui-icon layui-icon-key"></i>去自评</button>';
                        }

                        if (taskType === 1 && d.zpState !== 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            
                        } else if (taskType === 2 && d.zpState !== 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            if (d.hyState > 1) {
                                buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="hycheck"><i class="layui-icon layui-icon-key"></i>看核验</button>';
                            }
                        }
                    } else if (roleType === '3') {

                        if (taskType === 2 && d.hyState === 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="hy"><i class="layui-icon layui-icon-key"></i>去核验</button>';
                        }
                        if (taskType === 2&& d.hyState === 2) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="hycheck"><i class="layui-icon layui-icon-key"></i>看核验</button>';
                        }
                        if (taskType === 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            
                        }
                    }
                    // if(d.zpRemark != null&&d.zpRemark != ''){
                    //     buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="download"><i class="layui-icon layui-icon-download-circle"></i>凭证</button>';
                    // }

                    return buttons; // 返回生成的按钮

                },

                align: 'center' // 对齐方式
            }

        ]]
    }else{
       return  [[
            {type: 'checkbox',hide:showCheckBox , fixed: 'left'},
            {type:'numbers',title:'序号',fixed:'left',width:80,align:'center'},
            { field: 'systemName',align:'center', minWidth:200, title: '系统名称' },
            { field: 'totalScore',align:'center', width:110, title: '系统总分' },
            { field: 'pfPerson',align:'center', width: 110, title: '自评人' },
            { field: 'pfScoreWeight',align:'center', width: 110, title: '自评得分' ,templet:function(d){
                return d.pfScoreZz+' / '+ d.pfScoreWeight;
            }},
            {
                field: 'zpState',align:'center', width: 110, title: '自评状态', templet: function (d) {
                    if (d.zpState == null) {
                        return '<span >--</span>';
                    } else if (d.zpState === 1) {
                        return '<span class="layui-font-red ">未提交</span>';
                    } else if (d.zpState === 2) {
                        return '<span class="layui-font-green">已提交</span>';
                    }
                }
            },
            {
                field: 'modifyTime',align:'center', width: 180, title: '最后修改时间', templet: function (d) {
                    return d.modifyTime == null ? d.createTime : d.modifyTime;
                }
            },
            {
                title: '操作',
                fixed:'right',
                style:'text-align:left;',
                minWidth: 220,
                templet: function (d) {
                    var roleType = localStorage.getItem("roleType"); // 获取角色类型
                    var buttons = ''; // 按钮字符串
                    // 根据 roleType 和相关状态判定按钮显示的逻辑
                    if (roleType === '4') {
                        if (d.zpState === 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zp"><i class="layui-icon layui-icon-key"></i>去自评</button>';
                        }

                        if (taskType === 1 && d.zpState !== 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            
                        } else if (taskType === 2 && d.zpState !== 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            if (d.hyState > 1) {
                                buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="hycheck"><i class="layui-icon layui-icon-key"></i>看核验</button>';
                            }
                            
                        }
                    } else if (roleType === '3') {

                        if (taskType === 2 && d.hyState === 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="hy"><i class="layui-icon layui-icon-key"></i>去核验</button>';
                        }
                        if (taskType === 2&& d.hyState === 2) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="hycheck"><i class="layui-icon layui-icon-key"></i>看核验</button>';
                        }
                        if (taskType === 1) {
                            buttons += '<button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" lay-event="zpcheck"><i class="layui-icon layui-icon-search"></i>看自评</button>';
                            
                        }
                    }

                    return buttons; // 返回生成的按钮

                },

                align: 'center' // 对齐方式
            }

        ]]
    }
}